package ModelLayer;
import java.util.ArrayList;

/**
 * Write a description of class Person here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Person
{
    // instance variables - replace the example below with your own
    public static int id;
    public String name;
    public String city;
    public String adresse;
    public String postCode;
    public String tlfnr;
    public static ArrayList<Udlaan> udlaans;
    public static ArrayList<Person> persons;
    /**
     * Constructor for objects of class Person
     */
    public Person(int id, String name, String city, String adresse, String postCode, String tlfnr)
    {
        this.id = id;
        this.name = name;
        this.city = city;
        this.adresse = adresse;
        this.postCode = postCode;
        this.tlfnr = tlfnr;
        udlaans = new ArrayList<Udlaan>();
    }

    // Set methods (Mutators)
    
    public void addUdlaan(Udlaan udlaan) 
    {
        udlaans.add(udlaan);
        for(Udlaan udlaanFor : udlaans) {
            udlaanFor.udlaant = true; // Changes the status for udlaant to true.
        }
    }
    
    public void deliverUdlaan(Udlaan udlaan) 
    {
        udlaans.remove(udlaan);
        for(Udlaan udlaanFor : udlaans) {
            udlaanFor.udlaant = false; // Changes the status for udlaant to true.
        }
    }

    public void newName(String name) 
    {
        this.name = name;
    }

    public void newcity(String city) 
    {
        this.city = city;
    }

    public void newAdresse(String adresse) 
    {
        this.adresse = adresse;
    }
    
    public void newPostCode(String postCode)
    {
        this.postCode = postCode;
    }

    public void newTlfnr(String tlfnr) 
    {
        this.tlfnr = tlfnr;
    }

    // Get methods
    
    public void getLent() 
    {
       for(Udlaan u : udlaans)
       {
           u.getDVDTitles();
       }
       
    }

    public String printname() 
    {
        return name;
    }    

    public String printcity() 
    {
        return city;
    }

    public String printAdresse() 
    {
        return adresse;
    }
    
    public String printPostCode()
    {
        return postCode;
    }

    public String printTlfnr() 
    {
        return tlfnr;
    }

}
